/**
 * Copyright (c) 2011-2014, homeant (homeanter@163.com).
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package xin.homeant.redis;

import org.springframework.stereotype.Service;

import xin.homeant.cache.annotation.Cache;
import xin.homeant.cache.type.CacheOpType;

/**
 * <P>
 * TODO
 * </P>
 * 
 * @author homeant homeanter@163.com
 * @Data 2017年5月28日 下午2:19:19
 */
@Service
public class UserService {
	@Cache(expire = 1000, key = "'users'+@@hash(#args)")
	public User getUser(String username){
		User user = new User();
		user.setUsername(username);
		return user;
	}
	
	@Cache(expire = 1000, key = "'users'",opType=CacheOpType.WRITE,hfield="@@hash(#args[0])")
	public void addUser(String username,String passwd){
		
	}
}
